package com.yxy.f_music_server.controller;

import com.yxy.f_music_server.common.Result;
import com.yxy.f_music_server.constant.RequestMapperConstant;
import com.yxy.f_music_server.domain.vo.VersionVO;
import com.yxy.f_music_server.service.VersionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(RequestMapperConstant.COMMON_REQUEST_MAPPER)
@Slf4j
public class CommonController {

    @Autowired
    private VersionService versionService;

    /**
     * 获取版本信息
     * @return
     */
    @GetMapping("/getVersion")
    public Result<VersionVO> getVersion(){
        log.info("获取版本信息");
        VersionVO vo = versionService.getVersion();
        return Result.success("", vo);
    }
}
